<!-- 收货方扫描签收的数量确认列表 -->
<template>
  <div class="gridContainer">
    <div class="m-det-warp mb30">
      <div class="m-det-tit">业务单号：YW2019031100001</div>
      <div class="m-det-list">
        <ul class="m-det-ul">
          <li class="displayflex">
            <span class="label">制单时间</span>
            <div class="flex1 value">2019-03-11</div>
          </li>
          <li class="displayflex">
            <span class="label">送货联系人</span>
            <div class="flex1 value">某某 18098765678</div>
          </li>
          <li class="displayflex">
            <span class="label">总件数</span>
            <div class="flex1 value"><em class="red">33</em>件</div>
          </li>
        </ul>
      </div>
    </div>
    <div class="mb30" >
      <div class="m-list-warp">
        <div class="m-list-pictxt">
          <div class="displayflex">
            <div class="pic w200"><img src=""></div>
            <div class="m-list-txt flex1">
              <p>商品名称</p>
              <p class="gray">1*2</p>
              <p class="gray">生产厂家</p>
              <p>共<em class="red">{{PKG}}</em>件</p>
            </div>
          </div>
        </div>
      </div>
      <div class="m-checknum-wrap displayflex">
        <span class="cn-lft">交货件数:</span>
        <div class="cn-ipt-wrap flex1 cf">
          <div class="cn-ipt-box f-l cf">
            <span class="llse llse-minus f-l"
              @click="changeNum(-1)"></span>
            <span class="ipt f-l">
              <input class="red" type="text"
                     v-model="RecPKG"
                     @input="addSum(index)">
            </span>
            <span class="llse llse-add f-r"
              @click="changeNum(1)"></span>
          </div>
          <span class="cn-unit f-l">件</span>
        </div>
        <div class="btn-checknum" @click="pick">确认</div>
        <div class="flex1 cn-rece">
          <div>交货件数:<em>33件</em></div>
          <div class="icon-rece"><img src="~images/icon/tag_yth.png"></div>
        </div>
      </div>
    </div>
    <div class="w100fix"></div>
    <div class="checknum-bot displayflex">
      <div class="num">共<em class="red">{{RecPKG}}</em>件商品</div>
      <div class="flex1">
        <ul class="cf cn-btn-grp f-r">
          <li class="btn-checknum f-l cancel" @click="goReceive">取消</li>
          <li class="btn-checknum f-l" @click="Confirm()">确认交货</li>
        </ul>
      </div>
    </div>
  </div>
</template>


<script>
export default {
  data() {
    return {
      //商品列表
      todolist:'',
      //全部数据
      datas: [],
      ReceiverID: '',
      PRContactsTel:'',
      //原始数量
      originNum:[],
      //是否点击单个签收
      clickBtn:[],
      //签收总数
      goodSum:0,
      PKG:33,
      RecPKG:33,
    };
  },
  methods: {
      changeNum(way){
          if(way > 0){
              if (this.RecPKG==this.PKG) {
                  this.Toast({
                      message:'请输入小于或等于总数',
                  });
                  return false;
              }
              this.RecPKG++;
          } else if (way < 0 && this.RecPKG>0) {
              this.RecPKG--;
          } else {
              this.Toast({
                  message:'请输入大于或等于0的数',
              });
          }
      },
      pick(e) {
      var tar = $(e.target);
      tar.siblings(".cn-lft").hide();
      tar.siblings(".cn-ipt-wrap").hide();
      tar.siblings(".cn-rece").show();
      tar.hide();
      tar.parent().siblings(".icon-rece").show();
    },
      Confirm(){
        this.$router.push({
          path: '/handovercomfirmpic'
        });
      },
      goReceive(){
        this.$router.push({
          path: '/receivelist'
        });
      }
  },
};
</script>